package com.android.propriedades;

import java.util.Properties;

import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;

public class Propriedades{
	/*
	Properties properties = new Properties();
	String CATEGORIA = "teste";
	SharedPreferences app_preferences;

	private static Propriedades instance;

	private Propriedades(Context contx) {

		app_preferences = PreferenceManager.getDefaultSharedPreferences(contx);
		this.setValorZeroQtdConsumida();
		this.setStatusOffAlarme();
		this.setRepetirDiariamente();
	}


	public static Propriedades getInstance(Context contx) {
		if (instance == null) {
			instance = new Propriedades(contx);
			return instance;
		} else {
			return instance;
		}
	}

	public static Propriedades getInstance() {
			return instance;
	}


	public void setValueInt(String id, int val) {

		// Increment the counter
		SharedPreferences.Editor editor = app_preferences.edit();
		editor.putInt(id, val);
		editor.commit(); // Very important

	}
	
	private void setValorZeroQtdConsumida() {

		// Increment the counter
		SharedPreferences.Editor editor = app_preferences.edit();
		editor.putFloat("qtdConsumida", 0);
		editor.commit(); // Very important

	}
	
	public void setDefaultValues(){
		this.setValorZeroQtdConsumida();
	}
	
	//Armazena o Alarme como DESATIVADO
	private void setStatusOffAlarme() {
		// Increment the counter
		SharedPreferences.Editor editor = app_preferences.edit();
		editor.putString("statusAlarme", "DESACTIVED");
		editor.commit(); // Very important
	}
	
	private void setRepetirDiariamente() {
		// Increment the counter
		SharedPreferences.Editor editor = app_preferences.edit();
		editor.putString("statusRepetir", "DESACTIVED");
		editor.commit(); // Very important
	}
	
	
	public void setValueFloat(String id, Float val) {

		// Increment the counter
		SharedPreferences.Editor editor = app_preferences.edit();
		editor.putFloat(id, val);
		editor.commit(); // Very important
	}

	public int getValueInt(String id) {
		// Get the value for the run counter
		int counter = app_preferences.getInt(id, 0);
		return counter;
	}
	
	public float getValueFloat(String id) {
		// Get the value for the run counter
		float counter = app_preferences.getFloat(id, 0);
		return counter;
	}
	
	public void setValueString(String id, String val) {
		// Increment the counter
		SharedPreferences.Editor editor = app_preferences.edit();
		editor.putString(id, val);
		editor.commit(); // Very important
	}
	
	public String getValueString(String id) {
		// Get the value for the run counter
		String counter = app_preferences.getString(id, "0");
		return counter;
	}
	*/
}
